package Domd1;
import static java.lang.Math.*;
 class test1 {
     public static void main(String[] args) {
       Student2 stu1=new Student2();//3-2
       Student2 stu2=null;
       stu2=stu1;
         stu1.name="小明";
         stu1.age=20;
         stu2.age=50;
         stu1.read();
         stu2.read();
         Student1 stu3=new Student1();
         stu3.name="小红";
         stu3.read();
     }
 }
 class Student1 {
     String name;
     void read() {

         System.out.println("大家好，我是" + name );
     }
 }
 class  Student2 {
     String name;
     int age;
     void read(){
         System.out.println("大家好，我是" + name + ",年龄" + age);
     }
 }